import React, { Component } from 'react';
import { inject, observer } from 'mobx-react';

@inject("aaa")
@observer
class App extends Component {
  componentDidMount() {
    this.props.aaa.getData();
  }

  render() {
    console.log(this.props.aaa);
    return (
      <div>
        <button onClick={this.props.aaa.increment}>+</button>
        <span>{this.props.aaa.getResult}</span>
        <button onClick={this.props.aaa.decrement}>-</button>
        <div>
          {
            this.props.aaa.users.map(user => (
              <div key={user.id}>
                <span>{user.id}</span>
                <span>{user.login}</span>
              </div>
            ))
          }
        </div>
      </div>
    )
  }
}

export default App;